package ord2.search;

import ord2.core.AbstractQuery;
import ord2.core.Result;
import java.util.List;
import ord2.core.Parameter;
import ord2.core.Parametric;

/**
 * This interface specifies operations that a searcher must provide.
 * This interface also tells that a query can be parameterized.
 *
 * @author José Ivan
 * @author Edviges
 *
 * @param <K> Type of object encapsulated by the query.
 * @param <T> Type of objects that will be returned by the query.
 */
public interface ParametricSearcher<K, T> extends Searcher<K, T>, Parametric {
    
    /**
     * Executes a query by this searcher with parameters
     * @param query Query that will be used.
     * @param pars Array of parameters that will be used in consult.
     * @return Collections of result of type <T> or null if none result.
     */
    List<Result<T>> query(AbstractQuery<K> query, Parameter[] pars);
}
